package com.sc.nft.feign;

import com.sc.nft.dto.AddMenuDTO;
import com.sc.nft.dto.AddMenusDTO;
import com.sc.nft.dto.IdRequest;
import com.sc.nft.dto.ModifyMenuDTO;
import com.sc.nft.sup.Result;
import com.sc.nft.vo.PermissionListMenuVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient(name = "nft-commercial", path = "/commercial/merchantMenu")
public interface MerchantMenuClient {

    /**
     * 新增菜单对象整体,例如:主+子集+权限 or 主+子 or 子+权限 or 子集
     *
     * @param addMenusDTO
     * @return
     */
    @PostMapping(value = "addPermissionMenu")
    Result addPermissionMenu(@RequestBody AddMenusDTO addMenusDTO);

    /**
     * 删除菜单
     *
     * @param idRequest
     * @return
     */
    @PostMapping(value = "deleteMenu")
    Result deleteMenu(@RequestBody IdRequest idRequest);

    /**
     * 修改菜单
     *
     * @param modifyMenuDTO
     * @return
     */
    @PostMapping(value = "modifyMenu")
    Result modifyMenu(@RequestBody ModifyMenuDTO modifyMenuDTO);

    /**
     * 新增菜单,该接口只新增一条给定数据. 父级的ID和条目类型完全由前端确定.
     *
     * @param addMenuDTO
     * @return
     */
    @PostMapping(value = "addMenu")
    Result addMenu(@RequestBody AddMenuDTO addMenuDTO);

    /**
     * 查询所有菜单
     *
     * @return
     */
    @PostMapping(value = "permissionListMenus")
    Result<List<PermissionListMenuVO>> permissionListMenus();

}

